#pragma once
#include "..\NCUCModel\NCUCModel.h"
#include "..\ACM(Automated Calibration Method)\ACMSimpleGAB2D.h"
#include "..\DataManipulation\InputData.h"
#include "..\DataManipulation\OutputData.h"
class Calibrator
{
public:
	// excute all necessary procedures
	void Run(const string& infilename, const string& outfilename);
	Calibrator(void);
	~Calibrator(void);
protected:
	// get optimal parameters and write it to the file
	void OptimalParameters();
	
	// write the runoff calculated using the optimal parameters to the file. That is the runoff during the calibration
	void RunoffCalibration();
	// write the runoff calculated using the optimal parameters to the file. That is the runoff during the validation
	void RunoffValidation();
	// calculate the CE value of the calibration and write to the file
	const double CE();
	// calculate the runoff using the optimal model parameters
	const vector<double> OptimalRunoff();
	// calculate the runoff using the optimal model parameters according to the optionl rainfall
	const vector<double> OptionalRunoff();
	// input file
	void InputFile(const string& filename);
	// save file
	void SaveFile(const string& filename);
	// initialize the Calibrator
	void initialize();
	// evolve
	void evolve();
private:
	NCUCModel m_model;
	ACMSimpleGAB2D m_acm;
	InputData m_indata;
	OutputData m_outdata;
};
